#include "ns3/log.h"
#include "testapp.h"
#include "ns3/core-module.h"

NS_LOG_COMPONENT_DEFINE ("TestApplication");

namespace ns3 {
    
NS_OBJECT_ENSURE_REGISTERED (TestApplication);

TypeId
TestApplication::GetTypeId (void)
{
  static TypeId tid = TypeId ("ns3::TestApplication")
    .SetParent<Application> ()
    .AddConstructor<TestApplication> ();
  return tid;
}

TestApplication::TestApplication ()
{
  NS_LOG_FUNCTION (this);
}

TestApplication::~TestApplication ()
{
  NS_LOG_FUNCTION (this);
}

// Application Methods
void TestApplication::StartApplication () // Called at time specified by Start
{
  NS_LOG_FUNCTION (this);
  NS_LOG_UNCOND ("Hello World!! at  " << Simulator::Now ().GetSeconds () << "s" );
  
}

void TestApplication::StopApplication () // Called at time specified by Stop
{
  NS_LOG_FUNCTION (this);
  NS_LOG_UNCOND ("GoodBye!! at " << Simulator::Now ().GetSeconds () << "s");
}


} // namespace ns3
